/*
 * Copyright (c) 2006 - 2022, webrx.cn All rights reserved.
 *
 */
package cn;

/**
 * <p>Project: app2022 - RegExp6
 * <p>Powered by webrx On 2022-01-13 17:39:12
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class RegExp6 {
    public static void main(String[] args) {
        /*
        要求：客户的姓名必须是 中文或英文，不可以是中英混合，不可能有特殊的称号
        name 张李 jack  李sir
         */
        String name = "Aa";
        String p = "[\u4e00-\u9fa5]{2,}|[a-zA-Z]{2,20}";
        System.out.println(name.matches(p));

        int age = 18;
        //age>=18 age <=36
        String a = "6";
        if(a.matches("\\d+")){
            int t = Integer.parseInt(a);
            if(t>=18 && t<=36){
                System.out.println("欢迎您：");
            }else{
                System.out.println("年龄不符合");
            }
        }else{
            System.out.println("年龄填写错误");
        }



    }
}
